package br.com.viewcar.service;

import java.util.List;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import br.com.viewcar.entity.Grupo;
import br.com.viewcar.util.CheckrotaUtil;

@Repository
@Transactional
public class GrupoService extends BaseService<Integer, Grupo> {
	
	@Transactional(readOnly = true)
	public List<Grupo> findByCliente(Integer clienteId) {

		if(CheckrotaUtil.isAdministradorSistema()) {
			return executeResultListQuery("findByCliente", clienteId);
		} else {
			return null;
		}
	}

}